extends Node2D

var effect_bigAttack = preload("res://游戏/特效/大子攻击/BigAttackEffect.tscn")
var effect_bigDie = preload("res://游戏/特效/大子死亡/BigDieEffect.tscn")
var effect_炮击 = preload("res://游戏/特效/炮台攻击/炮击.tscn")
var effect_毒爆 = preload("res://游戏/特效/病毒爆发/毒爆.tscn")
var effect_瞄准 = preload("res://游戏/特效/狙炮瞄准/瞄准.tscn")
var effect_阵法 = preload("res://游戏/特效/阵法/阵法.tscn")
var effect_怒威标记 = preload("res://游戏/特效/怒威标记/怒威标记.tscn")
var effect_拳击 = preload("res://游戏/特效/拳师拳击/拳师拳击.tscn")
var effect_冰冻 = preload("res://游戏/特效/妖术冰冻/妖术冰冻.tscn")
var effect_瘟疫 = preload("res://游戏/特效/妖术瘟疫/妖术瘟疫.tscn")

# 大子攻击
func bigAttack(point:Point):
	var node = effect_bigAttack.instantiate()
	node.position = point.position
	add_child(node)

# 大子死亡
func bigDie(point:Point,player:Player,isMurderer:bool):
	if !point.is_view && !isMurderer:
		return
	var node = effect_bigDie.instantiate()
	node.modulate = player.color
	node.position = point.position
	add_child(node)

func 大炮_bombing(point_start:Point,point_end:Point):
	if point_start.is_view || point_end.is_view:
		var node = effect_炮击.instantiate()
		node.position = point_start.position
		add_child(node)
		var tween = create_tween()
		tween.tween_property(node,"position",point_end.position,0.6)

func 狙炮_aim(big:Big,point:Point):
	var node = effect_瞄准.instantiate()
	node.init(big)
	node.position = point.position
	add_child(node)

# 毒爆
func poisonousExplosion(point:Point):
	if !point.is_view:
		return
	var node = effect_毒爆.instantiate()
	node.position = point.position
	add_child(node)

# 布阵
func 布阵(type:String, point:Point, big:Big):
	var node = effect_阵法.instantiate()
	node.init(type, big)
	node.position = point.position
	add_child(node)

# 怒威标记
func 怒威标记(qs:拳师, point:Point):
	var node = effect_怒威标记.instantiate()
	node.init(qs, point)
	add_child(node)

# 拳师拳击
func 拳击(point: Point, name: String):
	var node = effect_拳击.instantiate() as 拳击特效
	node.position = point.position
	add_child(node)
	node.playAnim(name)

# 妖术_冰冻
func 妖术_冰冻(point:Point):
	if !point.is_view:
		return
	var node = effect_冰冻.instantiate()
	node.position = point.position
	add_child(node)

# 妖术_瘟疫
func 妖术_瘟疫(point:Point):
	if !point.is_view:
		return
	var node = effect_瘟疫.instantiate()
	node.position = point.position
	add_child(node)
